CKEDITOR.plugins.add('wecenteruploadimage', {
    init: function (editor) {
        var pluginName = 'WecenterUploadImage';
        // CKEDITOR.dialog.add(pluginName, this.path + 'dialogs/wecenterimage.js');
        // editor.addCommand(pluginName, new CKEDITOR.dialogCommand(pluginName));
        editor.addCommand(pluginName, {
            exec: function (editor) {
                // var now = new Date();
                // editor.insertHtml( 'The current date and time is: <em>' + now.toString() + '</em>' );
                // var fileupload = new FileUpload('file', 'a.cke_button__wecenteruploadimage', '.aw-editor-box .aw-upload-box .upload-container', G_BASE_URL + '/publish/ajax/attach_upload/id-' + PUBLISH_TYPE + '__attach_access_key-' + ATTACH_ACCESS_KEY, {
                //     'editor': editor
                // });
            }
        });
        editor.ui.addButton(pluginName,
            {
                label: editor.lang.common.image,
                command: pluginName,
                toolbar: pluginName
            });
    }
});